import { FilterConst } from "../../../../component/gconst/FilterConst";
import { GTextFormat } from "../../../../common/GTextFormat";
import { BossAreaInfo } from "../../../model/BossAreaInfo";
import { HTMLUtil } from "../../../../../com/gengine/utils/HTMLUtil";
//class BossAreaItem
    
    export  class BossAreaItem /* flash.display.Sprite */
    {
        constructor()
        {
            
            mouseChildren = false;
            mouseEnabled = false;
            this._nameLabel = new Object /* flash.text.TextField */();
            this._nameLabel.htmlText = "";
            this._nameLabel.selectable = false;
            this._nameLabel.filters = [FilterConst.nameGlowFilter];
            this._nameLabel.defaultTextFormat = new GTextFormat("小篆", 12, 65280, null, null, null, null, null, flash.text.TextFormatAlign.CENTER);
            this._nameLabel.autoSize = flash.text.TextFieldAutoSize.CENTER;
            addChild(this._nameLabel);
            return;
        }

        public set data(arg1: BossAreaInfo)
        {
            this._data = arg1;
            this._nameLabel.htmlText = HTMLUtil.addColor(this._data.name, "#00ff00");
            this._nameLabel.width = this._nameLabel.textWidth + 4;
            this._nameLabel.height = this._nameLabel.textHeight + 4;
            return;
        }

        public get data(): BossAreaInfo
        {
            return this._data;
        }

        public dispose(): void
        {
            flash.utils.clearTimeout(this._timeKey);
            this._data = null;
            return;
        }

        public /* override */ get width(): number
        {
            return this._nameLabel.width;
        }

        public /* override */ get height(): number
        {
            return this._nameLabel.height;
        }

        /* internal */ /* var */_nameLabel: Object /* flash.text.TextField */;

        /* internal */ /* var */_data: BossAreaInfo;

        /* internal */ /* var */_timeKey: uint;
    }
